package com.book.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.List;

//订单状态
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "bs_order")
public class Order extends Model<Order>{

    @TableId(type = IdType.AUTO)
    private Integer id;
    private String orderNum;  //订单编号
    private Date createDate;  //创建时间
    private Integer userId;
    private Integer addressId;
    private String orderStatus;  //订单状态


    @TableField(exist = false)
    private User user;   //用户信息

    @TableField(exist = false)
    private Address address;  //地址信息

    @TableField(exist = false)
    private List<OrderItem> orderItems;  //订单明细
}
